// 引入工具类
import axios from '../config'
// 使用
const URL = 'api-ca' // 公共前缀地址
const PARAMURL = 'api-param'
export const ruleDefinition = {
    // ca 规则定义
    // 查询
    ruleBaseQuery(data) {
        return axios.post(URL + '/ca/ruleBase/query', data)
    },
    // 删除
    ruleBaseRemove(data, loading = false) {
        return axios.post(URL + '/ca/ruleBase/remove', data, loading)
    },
    // 规则定义基本信息保存
    ruleBaseSave(data) {
        return axios.post(URL + '/ca/ruleBase/save', data)
    },
    // 规则定义保存数据来源
    ruleBaseDetailSave(data) {
        return axios.post(URL + '/ca/ruleBaseDetail/save', data)
    },
    // 规则定义保存分摊动因
    ruleBaseDriverSave(data) {
        return axios.post(URL + '/ca/ruleBaseDriver/save', data)
    },
    // 保存规则定义输出内容
    ruleBaseDetailSaveOutPut(data) {
        return axios.post(URL + '/ca/ruleBaseDetail/saveOutPut', data)
    },
    // 跳转初始化页面 基本信息
    ruleBaseToInit(data) {
        return axios.post(URL + '/ca/ruleBase/toInit', data)
    },
  
    // 数据来源获取维度筛选数据
    ruleBaseDetailGetDataFilter(data, loading = false) {
        return axios.post(URL + '/ca/ruleBaseDetail/getDataFilter', data,loading)
    },
    // // 保存规则明细
    // ruleBaseDetailSave(data) {
    //     return axios.post(URL + '/ca/ruleBaseDetail/save', data)
    // },
    // 规则定跳转数据来源查询数据
    ruleBaseDetailToForm(data) {
        return axios.post(URL + '/ca/ruleBaseDetail/toForm', data)
    },
    // 规则定义编辑跳转输出内容
    ruleBaseDetailToOutput(data) {
        return axios.post(URL + '/ca/ruleBaseDetail/toOutput', data)
    },
    // 查询场景列表数据 基础信息用
    ruleSceneComboAll(data, loading = false) {
        return axios.post(URL + '/ca/ruleScene/comboAll', data, loading)
    },
   
    // 规则备注
    pubNoteQuery(data){
        return axios.post(URL + '/ca/pubNote/query', data)
    },
    // 备注删除
    pubNoteRemove(data, loading = false){
        return axios.post(URL + '/ca/pubNote/remove', data, loading)
    },
    // 备注保存
    pubNoteSave(data){
        return axios.post(URL + '/ca/pubNote/save', data)
    },
    // 跳转备注页面规则查询
    pubNoteToForm(data){
        return axios.post(URL + '/ca/pubNote/toForm', data)
    },
    // 分摊动因
    ruleDriverQueryForCombobox(data, loading = false){
        return axios.post(URL + '/ca/ruleDriver/queryForCombobox', data, loading)
    },
    // 规则关联的动因
    ruleBaseDriverQueryData(data, loading = false){
        return axios.post(URL + '/ca/ruleBaseDriver/queryData', data, loading)
    },
    // 获取机构树的接口
    ruleBaseDetailFindAllTreeType(data){
        return axios.post(URL + '/ca/ruleBaseDetail/findAllTreeType', data)
    },
    // 获取分摊动因详情
    ruleDriverQuery(data){
        return axios.post(URL + '/ca/ruleDriver/query', data)
    },
    // 获取账户费用接收字段列表
    pubCountFeeFieldQueryList(data, loading = false ){
        return axios.post(URL + '/ca/pubCountFeeField/queryList', data, loading)
    },
    // 规则运行
    ruleBaseRunRule(data, loading = false ){
        return axios.post(URL + '/ca/ruleBase/runRule', data, loading)
    },

    //////////////////公共参数的接口///////////////////////////////
      // 获取relatedDimensionCode不为null的金融工具表维度定义列表(CA)
    queryDimColumn(data, loading = false) {
        return axios.post(PARAMURL + '/cpm/fundToolTableColumn/queryDimColumn', data,loading)
    },
     // 获取业务表
    qeuryListForRule(data, loading = false){
        return axios.post(PARAMURL + '/cpm/fundToolTable/qeuryListForRule', data,loading)
    },
    // 根据业务表查询业务字段
    queryListCa(data, loading = false){
        return axios.post(PARAMURL + '/cpm/fundToolTableColumn/queryListCa', data, loading)
    },
    // 通过表名查询 过滤器
    pubFilterQueryComboForRule(data, loading = false){
        return axios.post(PARAMURL + '/param/pubFilter/queryComboForRule', data, loading)
    },
    // 所有成员
    dimDictitemQueryByRelatedDicttypeCode(data){
        return axios.post(PARAMURL + '/param/dimDictitem/queryByRelatedDicttypeCode', data)
    },
    // 查询机构树
    dimTreenodeQueryTreeNodeTree(data){
        return axios.post(PARAMURL + '/param/dimTreenode/queryTreeNodeTree', data,false)
    }
}